package com.zhan.easyexcelorder.vo;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Objects;

@Getter
@Setter
public class AddressBookVO implements java.io.Serializable, Comparable<AddressBookVO> {
    private static final long serialVersionUID = -4494870561731052719L;

    private Long id;
    private String type;
    private List<AddressBookUserVO> list;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AddressBookVO that = (AddressBookVO) o;
        return getId().equals(that.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }

    @Override
    public int compareTo(AddressBookVO o) {
        return id.compareTo(o.id);
    }
}
